#pragma once

#include "Misc/EngineEditorMacros.h"
#include "Widgets/Widget.h"
#include "EditorScrollWidget.m.h"

//scroll widget for file editor
RCLASS()
class REditorScrollWidget : public RWidget
{
    ROBJECT

public:
    REditorScrollWidget();

    //parent widget for content
    //must set width and height of content container
    TSharedObjectPtr<RWidget> GetContentContainer() const;

    RFIELD()
    TWidgetAttribute<float> MouseWheelSpeed = 20.f;

    TDelegate<float> OnGetVerticalPercent;
    TDelegate<void, float> OnSetVerticalPercent;

protected:
    TWeakObjectPtr<RWidget> ContentContainer;

    float VerticalPercent = 0.f;
};